﻿@model IEnumerable<AfrikDotnetWebSite.Models.Ad>

@{
    ViewBag.Title = "Ads";
}

<h2 class="box">Ads</h2>

<p class="box">
    @Html.ActionLink("Create New", "adadd")
</p>
<table class="box">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Image)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Owner)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.OwnerContact)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Link)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.AlternateText)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CreationDate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.StartDate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Duration)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            <img src="~/static/img/ads/@Html.DisplayFor(modelItem => item.Image)" style="width:100px" />
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Owner)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.OwnerContact)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Link)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.AlternateText)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CreationDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.StartDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Duration)
        </td>
        <td>
            @Html.ActionLink("Edit", "adedit", new { id=item.Id }) |
            @Html.ActionLink("Delete", "addelete", new { id=item.Id })
        </td>
    </tr>
}

</table>

<div>
    @Html.ActionLink("« Administration", "index")
</div>
